package chapter13;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by Caesar on 2016/2/25.
 */
public class Test11 {
    public static void main(String[] args) {
        String s = "Arline ate eight apples and one orange while Anite hadn't any";
        Pattern p = Pattern.compile("(?i)((^[aeiou])|(\\s+[aeiou]))\\w+?[aeiou]\\b");
        Matcher m = p.matcher(s);
        int i = 0;
        while (m.find()) {
            System.out.println("第" + (i++) + "处匹配位置: " + m.start() + "~" + m.end() + ";内容为: " + s.substring(m.start(), m.end()));
        }


    }
}
